package observer;

import lombok.extern.slf4j.Slf4j;

import java.util.Observable;

/**
 * @author zenghy
 **/
@Slf4j
public class Subject extends Observable {

    private int state;

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
        setChanged();
        notifyAllObservers();
    }

    public void notifyAllObservers() {
        notifyObservers(this.state);
    }
}
